<template>
	<view class="product">
		<view class="detail-t">
			<image :src="productList.cover_img" mode=""></image>
			<view class="collect"><image src="../../../static/image/icons/cart.png" mode=""></image></view>
		</view>
		<view class="detail-c">
			<view class="title">
				<view class="cname">{{ productList.gname }}</view>
				<view class="ename">
					EnglistName
				</view>
			</view>
			<view class="info">	
				<view class="color">
					<view class="c1" :style="{ 'background-color': 'red' }"></view>
					<view class="c1" :style="{ 'background-color': 'yellow' }"></view>
					<view class="c1" :style="{ 'background-color': 'blue' }"></view>
				</view>
				<view class="price">
					￥{{productList.price_now}}
				</view>
			</view>
			<view class="desc" v-html="productList.content">
				
			</view>
			
		</view>
	</view>
</template>

<script>
import	{ product } from '../../../utils/find/product/index.js';
	export default {
		data() {
			return {
				productId: '',
				productList: []
			};
		},
		methods: {
		async	getProductDetail () {
				let data = await product({
					productId: this.productId
				});
				this.productList = data.data.data;
				console.log(this.productList)
			}
		},
		onLoad(option) {
			console.log(option)
			this.productId = option.id;
			this.getProductDetail();
		}
	}
</script>

<style lang="scss">
.product {
	.detail-t {
		position: relative;
		height: 546rpx;
		image {
			width: 100%;
			height: 100%;
			border-radius: 0 0 0 200rpx;
		}
		.collect {
			position: absolute;
			right: 96rpx;
			bottom: -50rpx;
			width: 100rpx;
			height: 100rpx;
			border-radius: 50%;
			background-color: #354e44;
			display: flex;
			justify-content: center;
			align-items: center;
			z-index: 10;
			image {
				width: 48rpx;
				height: 42rpx;
			}
		}
	}
	.detail-c {
		margin-top: 84rpx;
		box-sizing: border-box;
		padding: 0 76rpx 0 78rpx;
		width: 100%;
		.title {
			.cname {
				font-size: 36.4rpx;
				color: #3E3E3E;
				letter-spacing: 2.6rpx;
				font-weight: bolder;
			}
			.ename {
				font-size: 30.8rpx;
				color: #B0B0B0;
				letter-spacing: 2.2rpx;
			}
		}
		.info {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 17rpx;
			.color {
				display: flex;
				.c1 {
					width: 28rpx;
					height: 28rpx;
					border-radius: 50%;
					margin-right: 10rpx;
				}
			}
			.price {
				font-size: 36.4rpx;
				color: #3E3E3E;
				letter-spacing: 2.6rpx;
				font-weight: bolder;
			}
		}
		.desc {
			margin-top: 75rpx;
			font-size: 28rpx;
			color: #8A8A8A;
			letter-spacing: 2rpx;
		}
	}
}
</style>
